/*
 * gx_array.h
 *
 *  Created on: Apr 10, 2012
 *      Author: zhanggx
 */

#ifndef GX_ARRAY_H_
#define GX_ARRAY_H_

#include "gx.h"

struct gx_array_s{
	void* 			head;
	//total capacity
	gx_uint32_t		capacity;

	ssize_t 		elt_size;
	gx_uint32_t		nelts;

	int is_init;
};

int   gx_array_is_init(gx_array_t* array);
int   gx_array_init(gx_array_t* array, gx_int32_t capacity, gx_int32_t elt_size);
void* gx_array_push(gx_array_t* array);
void* gx_array_get(gx_array_t* array, int index);
void gx_array_destroy(gx_array_t* array);
#endif /* GX_ARRAY_H_ */
